/*!*********************************************************************************
 * X2Engine Open Source Edition is a customer relationship management program developed by
 * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
 * California 94061, USA. or at email address contact@x2engine.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * X2 Engine" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by X2 Engine".
 **********************************************************************************/




@import "colors.scss";

#RecordViewWidgetManagerwidgets-container {
    .formSectionRow td {
        display: block;
        width: 100% !important;
    }
    .formItem.leftLabel > .formInputBox {
        width: 200px !important;
    }
}

#InlineRelationshipsWidget-widget-container- {
    .widget-title {
        min-width: 144px;
    }
    .x2-button-group {
        margin: 0;
    }

    td:first-child {
        cursor: pointer;
    }

    .detail-view-toggle {
        span {
            display: inline-block;
            width: 12px;
            height: 12px;
            position: relative;
            margin-right: 5px;
            top: -1px;
            font-size: 14px;
            color: grey;
            /* @theme color: text */
        }
    }
    .relationships-grid-details-container {

        & > td {
            border-top: 1px solid rgb(204, 204, 204);
            border-bottom: 1px solid rgb(204, 204, 204);
            /* @theme border-color: border */
        }
        &:last-child {
            & > td {
                border-bottom: none;
            }
        }
        & > td {
            padding: 0;
            white-space: normal;
        }
        table {
            margin: 0;
        }
        .detail-view {
            margin: 0px !important;
            border: none !important;
            
            .fa-caret-down,
            .fa-caret-right {
                display: none;
            }
            .formSectionShow + .sectionTitle {
                position: relative;
                left: -22px;
            }
        }
        .tableWrapper {
            display: block !important;
        }
    }
}

.rel-title-bar-button {
    box-sizing: border-box;
    margin: 0 !important;
    margin: 0 !important;
    position: relative;
    top: 1px;
    height: 20px;
    float: left;
    line-height: 19px !important;
    > span {
        margin-right: 4px;
        color: $highlightGreen;
    }
    padding: 0 18px !important; 
}

//#relationships-form.simple-mode {
//    .x2grid-header-container {
//        display: none;
//    }
//}

#relationships-grid {
    .items {
        border-left: none;
    }
    .title-bar {
        display: none;
    }
    tr.odd {
        /*background: #F1F1F1;*/
    }
    td.delete-button-cell {
        text-align: center;
    }
    .items {
        border-right: none;
    }
    .x2grid-body-container > .items {
        border-bottom: none;
        & > tbody > tr > td {
            border-right: none;
            & > a {
                max-width: 90%;
                display: inline-block;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }
    }
    .x2grid-body-container.x2grid-no-pager {
        border-bottom: none;
        padding-bottom: 2px;
    }
    .pager {
        margin-right: 2px;
        float: right;
        padding: 1px;
    }
}

#relationships-grid.has-pager ~ #new-relationship-form {
    position: relative;
    top: -24px;
    margin-bottom: -24px;
}

#quick-create-record {
    position: relative;
    top: 7px;
    right: 9px;
}

#InlineRelationshipsWidget-widget-container- .summary {
    padding: 5px;
}

#new-relationship-form {
    border-top: 1px solid $lightGray;
    box-sizing: border-box;
    padding: 6px;
}

#relationships-grid {
    .x2grid-header-container {
        border: none;
    }
    .x2grid-body-container {
        border: none;
        border-bottom: 1px solid rgb(197, 197, 197);
    }
}

#new-relationship-form div.row {
    label {
        font-weight: bold;
        font-size: 8pt;
        color: rgb(69, 69, 69);
        width: 60px;
    }
    * {
        display: inline-block;
    }
    link {
        display: none;
    }
    input[type="text"] {
        width: 192px;
        padding: 2px !important;
        border: 1px solid rgb(197, 197, 197);
        border-radius: 3px;
        margin-right: 5px;
        font-size: 12px;
    }
    select {
        width: 192px;
        padding: 2px !important;
        border: 1px solid rgb(197, 197, 197);
        border-radius: 3px;
        margin-right: 5px;
        font-size: 12px;
        width: 198px;
    }
}

/* Strange behavior: auto complete field and 
* select box 6 pixels shorter than told to be */

#inline-relationships-autocomplete-container {
    margin-top: 1px;
    + input {
        position: relative;
        top: 1px;
    }
}

#new-relationship-form {
    .record-name-autocomplete {
        width: 198px !important;
        height: 19px;
    }
    div.row {
        text-align: left;
        display: block;
        padding: 5px;
    }
}

#RelationshipLabelButton {
    border-radius: 2px;
    font-weight: bold;
    padding: 2px;
}

#quick-create-record {
    margin-left: 11px;
    margin-top: 2px;
    position: relative;
    top: 3px;
}

#add-relationship-button {
    margin-left: 65px;
    clear: both;
    margin-bottom: 0;
    margin-top: 0;
}
